#include <iostream>
#include <set>

struct Test
{
    void print() const
    {
        std::cout << id << ", " << issue << ", " << drop_id << std::endl;
    }
    bool operator<(const Test& other) const
    {
        if (id != other.id) return id < other.id;
        //if (issue != other.issue) return issue < other.issue;
        return drop_id < other.drop_id;
    }

    //bool operator==(const Test& other) const
    //{
        //return id == other.id && issue == other.issue && drop_id == other.drop_id;
        ////return id == other.id && issue == other.issue;
    //}
    //bool operator()(const Test& other) const
    //{
        //return id == other.id && issue == other.issue && drop_id == other.drop_id;
        ////return id == other.id && issue == other.issue;
    //}

    uint32_t id;
    uint32_t issue;
    uint32_t drop_id;
};

int main(int argc, const char **argv) {
    std::set<Test> t;
    Test x = {4,1,1};
    std::pair<std::set<Test>::iterator, bool> ret, ret1;
    ret1 = t.insert(x);
    x.print();
    std::cout << (ret1.second ? "true" : "fail") << std::endl;
    std::cout <<"ret1.first == t.begin() " << (ret1.first == t.begin() ? "true" : "fail") << std::endl;
    ret = t.insert(x);
    x.print();
    std::cout << (ret.second ? "true" : "fail") << std::endl;

    x = {1,1,2};
    ret = t.insert(x);
    x.print();
    std::cout << (ret.second ? "true" : "fail") << std::endl;
    std::cout <<"ret1.first == t.begin() " << (ret1.first == t.begin() ? "true" : "fail") << std::endl;

    x = {1,2,1};
    ret = t.insert(x);
    x.print();
    std::cout << (ret.second ? "true" : "fail") << std::endl;

    x = {1,2,2};
    ret = t.insert(x);
    x.print();
    std::cout << (ret.second ? "true" : "fail") << std::endl;

    ret1.first->print();

    std::cout << "----------------------------------------" << std::endl;
    for (auto& it : t) {
        it.print();
    }
    return 0;
}
